xen.git
20 years agoAlways EXPORT_SYMBOL pm_power_off now that pm_power_off is always defined.
cl349@firebug.cl.cam.ac.uk [Fri, 6 Jan 2006 15:24:46 +0000 (16:24 +0100)]
Always EXPORT_SYMBOL pm_power_off now that pm_power_off is always defined.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
20 years agoMove definition of pm_power_off to a more sensible location.
cl349@firebug.cl.cam.ac.uk [Fri, 6 Jan 2006 11:59:55 +0000 (12:59 +0100)]
Move definition of pm_power_off to a more sensible location.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
20 years agoFix a couple of bogus dom0_op names:
kaf24@firebug.cl.cam.ac.uk [Fri, 6 Jan 2006 11:53:19 +0000 (12:53 +0100)]
Fix a couple of bogus dom0_op names:
  setdomaininfo -> setvcpucontext
  pincpudomain  -> setvcpuaffinity

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoClean up xen-internal representation of per-vcpu
kaf24@firebug.cl.cam.ac.uk [Fri, 6 Jan 2006 11:25:47 +0000 (12:25 +0100)]
Clean up xen-internal representation of per-vcpu
physical cpu affinity. Rename idle_task variables and
macros to idle_domain.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoFix up x86 emulator header docs and ensure callers use
kaf24@firebug.cl.cam.ac.uk [Thu, 5 Jan 2006 11:19:12 +0000 (12:19 +0100)]
Fix up x86 emulator header docs and ensure callers use
the X86EMUL_MODE enumeration.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoThe dom0_ops implementation wasn't matching the interface definition,
kaf24@firebug.cl.cam.ac.uk [Wed, 4 Jan 2006 17:51:38 +0000 (18:51 +0100)]
The dom0_ops implementation wasn't matching the interface definition,
leading to ill messages when X starts up (and potentially to other
problems). The attached patch fixes that. However, it also points out
that there is a potential disagreement between the dom0_ops interface
and the internal MTRR interface - the former expects an unsigned
register number from the domain, the latter wants a signed one and does
a lookup when it's negative. I would think that the lookup code should
just be ripped out of xen/arch/x86/mtrr/main.c.

Signed-off-by: Jan Beulich <JBeulich@novell.com>
20 years agoFixes to mtrr interface code in linux guest.
kaf24@firebug.cl.cam.ac.uk [Wed, 4 Jan 2006 17:47:11 +0000 (18:47 +0100)]
Fixes to mtrr interface code in linux guest.

Signed-off-by: Jan Beulich <JBeulich@novell.com>
20 years agoAdd IO-APIC interrupt debugging to 'i' debug key.
kaf24@firebug.cl.cam.ac.uk [Wed, 4 Jan 2006 17:37:24 +0000 (18:37 +0100)]
Add IO-APIC interrupt debugging to 'i' debug key.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoFix split of duties between close_netdev() and
kaf24@firebug.cl.cam.ac.uk [Wed, 4 Jan 2006 13:45:52 +0000 (14:45 +0100)]
Fix split of duties between close_netdev() and
netif_disconnect_backend() in netif driver.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoAdd pending status to irq debugkey dump.
kaf24@firebug.cl.cam.ac.uk [Wed, 4 Jan 2006 11:37:27 +0000 (12:37 +0100)]
Add pending status to irq debugkey dump.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoAdd dubug key for dumping guest-bound physical interrupts
kaf24@firebug.cl.cam.ac.uk [Wed, 4 Jan 2006 11:18:02 +0000 (12:18 +0100)]
Add dubug key for dumping guest-bound physical interrupts
and their current status.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoThis patch adds TPM_Seal support to the VTSP. On measured platforms
kaf24@firebug.cl.cam.ac.uk [Wed, 4 Jan 2006 10:37:41 +0000 (11:37 +0100)]
This patch adds TPM_Seal support to the VTSP. On measured platforms
this can be use to better protect secrets in the VTPM System

Signed-off-by: Vinnie Scarlata <vincent.r.scarlata@intel.com>
20 years agomerge
kaf24@firebug.cl.cam.ac.uk [Tue, 3 Jan 2006 18:06:14 +0000 (19:06 +0100)]
merge

20 years agoMarge with xen-ia64-unstable.hg
kaf24@firebug.cl.cam.ac.uk [Tue, 3 Jan 2006 18:03:56 +0000 (19:03 +0100)]
Marge with xen-ia64-unstable.hg

20 years agoconvert latest old initializer to C99 initializer
vhanquez@kneesa.uk.xensource.com [Tue, 3 Jan 2006 16:57:41 +0000 (16:57 +0000)]
convert latest old initializer to C99 initializer

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
20 years agoAdapt xen-ia64 to changes in xen-unstable
djm@kirby.fc.hp.com [Tue, 3 Jan 2006 16:20:05 +0000 (10:20 -0600)]
Adapt xen-ia64 to changes in xen-unstable

20 years agoMerge
djm@kirby.fc.hp.com [Tue, 3 Jan 2006 16:19:20 +0000 (10:19 -0600)]
Merge

20 years agoSmall bug fixes
djm@kirby.fc.hp.com [Tue, 3 Jan 2006 14:59:00 +0000 (08:59 -0600)]
Small bug fixes

20 years agoRemove 03_network_attach_detach_multiple_pos.test from xfail list
emellor@leeni.uk.xensource.com [Tue, 3 Jan 2006 14:51:33 +0000 (14:51 +0000)]
Remove 03_network_attach_detach_multiple_pos.test from xfail list

Signed-off-by: Murillo F. Bernardes <mfb@br.ibm.com>
20 years agoVcpu-list's error message shows an unnecessary header.
emellor@leeni.uk.xensource.com [Tue, 3 Jan 2006 14:08:32 +0000 (14:08 +0000)]
Vcpu-list's error message shows an unnecessary header.

Signed-off-by: Yoshinori Katase <y_katase@soft.fujitsu.com>
20 years agoThese xm info, top, dmesg and log requre no parameter.
emellor@leeni.uk.xensource.com [Tue, 3 Jan 2006 14:07:43 +0000 (14:07 +0000)]
These xm info, top, dmesg and log requre no parameter.
But log's error message differs from other 3 command's error messages,
when parameter is given.

# xm log 1
Error: 'xm log' requires 0 argument.

   log                              Print the xend log

Other 3 commands ignore parameter.
I think it might be better symmetricalize.

Signed-off-by: Yoshinori Katase <y_katase@soft.fujitsu.com>
20 years agoMove public hvm interfaces into xen/include/public/hvm.
kaf24@firebug.cl.cam.ac.uk [Tue, 3 Jan 2006 13:58:34 +0000 (14:58 +0100)]
Move public hvm interfaces into xen/include/public/hvm.
Add new header hvm_info_table.h for defining location and
contents of acpi-style hvm_info_table. Remove duplicate
definition in vmxassist/acpi_madt.c.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agomerge
kaf24@firebug.cl.cam.ac.uk [Tue, 3 Jan 2006 13:36:56 +0000 (14:36 +0100)]
merge

20 years agoRename VMX option name lapic to apic, and pass it to xen by
kaf24@firebug.cl.cam.ac.uk [Tue, 3 Jan 2006 13:35:45 +0000 (14:35 +0100)]
Rename VMX option name lapic to apic, and pass it to xen by
hvm_info_table.  Previous we pass it to xen by guest vcpu context ECX
register, now we unify to use hvm_info_table.

Signed-off-by: Xin Li <xin.b.li@intel.com>
20 years agomerge
vhanquez@kneesa.uk.xensource.com [Tue, 3 Jan 2006 13:04:59 +0000 (13:04 +0000)]
merge

20 years agomixup during reorganization. when SIF_INITDOMAIN it should kcons_write_dom0
vhanquez@kneesa.uk.xensource.com [Tue, 3 Jan 2006 13:03:35 +0000 (13:03 +0000)]
mixup during reorganization. when SIF_INITDOMAIN it should kcons_write_dom0

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
20 years agoFix VMX disk config string parse (allow leading whitespace).
kaf24@firebug.cl.cam.ac.uk [Mon, 2 Jan 2006 10:35:29 +0000 (11:35 +0100)]
Fix VMX disk config string parse (allow leading whitespace).

Signed-off-by: Xin Li <xin.b.li@intel.com>
20 years agoProvide an option to disable ACPI from the VMX config file.
kaf24@firebug.cl.cam.ac.uk [Sun, 1 Jan 2006 10:29:17 +0000 (11:29 +0100)]
Provide an option to disable ACPI from the VMX config file.
By default ACPI is disabled.

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
20 years agofix possible memory leak if one of the kmalloc fail.
vhanquez@kneesa.uk.xensource.com [Sat, 31 Dec 2005 20:17:45 +0000 (20:17 +0000)]
fix possible memory leak if one of the kmalloc fail.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
20 years agoremove one pointless macro and make code paths explicit.
vhanquez@kneesa.uk.xensource.com [Sat, 31 Dec 2005 19:35:11 +0000 (19:35 +0000)]
remove one pointless macro and make code paths explicit.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
20 years agoreorganize code to avoid duplication
vhanquez@kneesa.uk.xensource.com [Sat, 31 Dec 2005 15:58:44 +0000 (15:58 +0000)]
reorganize code to avoid duplication

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
20 years agoConvert old initializer to C99 initializer.
vhanquez@kneesa.uk.xensource.com [Sat, 31 Dec 2005 14:20:01 +0000 (14:20 +0000)]
Convert old initializer to C99 initializer.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
20 years agodirectly return -ENOMEM instead of jumping to a return -ENOMEM label
vhanquez@kneesa.uk.xensource.com [Sat, 31 Dec 2005 14:17:10 +0000 (14:17 +0000)]
directly return -ENOMEM instead of jumping to a return -ENOMEM label

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
20 years agomove error handling out of line to avoid duplicated code.
vhanquez@kneesa.uk.xensource.com [Sat, 31 Dec 2005 14:16:13 +0000 (14:16 +0000)]
move error handling out of line to avoid duplicated code.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
20 years agoClean up 'q' debug key output.
kaf24@firebug.cl.cam.ac.uk [Sat, 31 Dec 2005 13:33:00 +0000 (14:33 +0100)]
Clean up 'q' debug key output.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoAllow non-privileged domains restricted access to
kaf24@firebug.cl.cam.ac.uk [Sat, 31 Dec 2005 13:15:22 +0000 (14:15 +0100)]
Allow non-privileged domains restricted access to
I/O memory and physical interrupts, under control
of domain0. Capabilities are maintained as rangesets
in Xen.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoStore admin-specified ioport capabilities in a rangeset
kaf24@firebug.cl.cam.ac.uk [Sat, 31 Dec 2005 12:11:47 +0000 (13:11 +0100)]
Store admin-specified ioport capabilities in a rangeset
rather than a bitmap. arch_do_createdomain() can now
fail and the caller will clean up.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoEnable stack trace on Xen BUG (by Isaku Yamahata)
djm@kirby.fc.hp.com [Sat, 31 Dec 2005 05:40:13 +0000 (23:40 -0600)]
Enable stack trace on Xen BUG (by Isaku Yamahata)

20 years agoPlumb through nr_pages -- needed for correct balloon driver function
djm@kirby.fc.hp.com [Fri, 30 Dec 2005 22:11:08 +0000 (16:11 -0600)]
Plumb through nr_pages -- needed for correct balloon driver function

20 years agoMissing initialization in cache sync code (by Anthony Xu)
djm@kirby.fc.hp.com [Fri, 30 Dec 2005 18:55:19 +0000 (12:55 -0600)]
Missing initialization in cache sync code (by Anthony Xu)

20 years agoFix a missing break in ioemu command-line parsing switch
kaf24@firebug.cl.cam.ac.uk [Fri, 30 Dec 2005 16:12:40 +0000 (17:12 +0100)]
Fix a missing break in ioemu command-line parsing switch
statement.

Signed-off-by: Xin Li <xin.b.li@intel.com>
20 years agoFix rdmsrl() for x86_32 -- high 32 bits must be cast to
kaf24@firebug.cl.cam.ac.uk [Fri, 30 Dec 2005 16:11:05 +0000 (17:11 +0100)]
Fix rdmsrl() for x86_32 -- high 32 bits must be cast to
u64 before shifting left.

Signed-off-by: Avi Kivity <avi@qumranet.com>
20 years agoAvoid xen crash if there is no VMX support. If a platform
kaf24@firebug.cl.cam.ac.uk [Fri, 30 Dec 2005 16:07:34 +0000 (17:07 +0100)]
Avoid xen crash if there is no VMX support. If a platform
doesn't support VMX, creating VMX domain will crash xen
HV.

Signed-off-by: Xin Li <xin.b.li@intel.com>
20 years agoMove initial stack-pointer adjustment into assembly
kaf24@firebug.cl.cam.ac.uk [Fri, 30 Dec 2005 16:02:30 +0000 (17:02 +0100)]
Move initial stack-pointer adjustment into assembly
bootstrap code. Avoids need for indirection thru
reset_stack_and_jump() in C code (which was incorrect for
secondary CPUs since nothing was pushed on the stack on
that initial call, hence the masking operation had no
effect and we ended up running on a bogus stack pointer).

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoVirtual TPM persistent states contain VTPM secrets, which are encrypted
kaf24@firebug.cl.cam.ac.uk [Fri, 30 Dec 2005 10:31:12 +0000 (11:31 +0100)]
Virtual TPM persistent states contain VTPM secrets, which are encrypted
using symmetric keys and stored on disk along with those symmetric keys.
The attached patch uses the TPM to encrypt the symmetric keys and other
global secrets before saving them to disk.

Signed-off-by: Vinnie Scarlata <vincent.r.scarlata@intel.com>
20 years agoEnsure initrd fields are set to 0 when no initrd is present (by Kevin Tian)
djm@kirby.fc.hp.com [Thu, 29 Dec 2005 21:31:18 +0000 (15:31 -0600)]
Ensure initrd fields are set to 0 when no initrd is present (by Kevin Tian)

20 years agoLeave psr.ic on in pal_cache_flush -- fixes Linux bug (by Anthony Xu)
djm@kirby.fc.hp.com [Thu, 29 Dec 2005 21:21:39 +0000 (15:21 -0600)]
Leave psr.ic on in pal_cache_flush -- fixes Linux bug (by Anthony Xu)

20 years agoExtend the range abstraction by adding an internal
kaf24@firebug.cl.cam.ac.uk [Thu, 29 Dec 2005 17:39:50 +0000 (18:39 +0100)]
Extend the range abstraction by adding an internal
insert_range() helper function. Pretty printer uses
the internal abstractions rather than accessing the
linked list directly.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoAdd a little more internal abstraction to the rangeset
kaf24@firebug.cl.cam.ac.uk [Thu, 29 Dec 2005 17:16:01 +0000 (18:16 +0100)]
Add a little more internal abstraction to the rangeset
library, avoiding direct interaction with the linked-list
structure.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoReset the stack pointer on every cpu early during bootstrap.
kaf24@firebug.cl.cam.ac.uk [Thu, 29 Dec 2005 16:53:22 +0000 (17:53 +0100)]
Reset the stack pointer on every cpu early during bootstrap.
Ensures we do not overlap with the cpu_info structure.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoInitialise grant tables via core_initcall so that it happens
kaf24@firebug.cl.cam.ac.uk [Thu, 29 Dec 2005 16:37:08 +0000 (17:37 +0100)]
Initialise grant tables via core_initcall so that it happens
suitably early during the boot process.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoVarious fixes to Xen stack management. Ensure the cpu0_stack
kaf24@firebug.cl.cam.ac.uk [Thu, 29 Dec 2005 15:59:12 +0000 (16:59 +0100)]
Various fixes to Xen stack management. Ensure the cpu0_stack
is always sufficiently aligned (requires some linker script
tricks). Small fixes to show_trace() and ensure that Xen
stack pointers are always below the 'struct cpu_info' region.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoAdd auto-destructing per-domain rangeset data structure,
kaf24@firebug.cl.cam.ac.uk [Thu, 29 Dec 2005 14:47:23 +0000 (15:47 +0100)]
Add auto-destructing per-domain rangeset data structure,
for representing sets of contiguous numeric ranges. This
will be used for representing permissions lists (e.g.,
io memory, io ports, irqs).

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoSync caches only on split cache machines (dynamic test instead of compile ifdef)
djm@kirby.fc.hp.com [Wed, 28 Dec 2005 21:07:30 +0000 (15:07 -0600)]
Sync caches only on split cache machines (dynamic test instead of compile ifdef)
Signed-off-by: Dan Magenheimer <dan.magenheimer@hp.com>
20 years agoFix iobmp_mask setup when permitting a domU access to
kaf24@firebug.cl.cam.ac.uk [Wed, 28 Dec 2005 15:23:42 +0000 (16:23 +0100)]
Fix iobmp_mask setup when permitting a domU access to
I/O port ranges.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
20 years agoFix a leak occurring at netif_map(). The problem raised after allocating
kaf24@firebug.cl.cam.ac.uk [Wed, 28 Dec 2005 14:17:04 +0000 (15:17 +0100)]
Fix a leak occurring at netif_map(). The problem raised after allocating
both {rx,tx}_comms_area, and one (and just one) of them failed. As we
were
doing a single test for both, returning would leave one of them
allocated.

Signed-off-by: Glauber de Oliveira Costa <glommer@br.ibm.com>
20 years agoSet up X11 authorization when a VMX domain uses SDL.
kaf24@firebug.cl.cam.ac.uk [Wed, 28 Dec 2005 14:14:23 +0000 (15:14 +0100)]
Set up X11 authorization when a VMX domain uses SDL.

Signed-off-by: Hiromichi Itou <ito@begi.net>
20 years agoReorganizes network frontend device unregister and removal, so that
kaf24@firebug.cl.cam.ac.uk [Wed, 28 Dec 2005 14:07:43 +0000 (15:07 +0100)]
Reorganizes network frontend device unregister and removal, so that
occur in the right order and succeed.

Now on Closing state we:
- stop queue
- unbind irq
- unregister the device

On removal:
- end foreign access to TX and RX pages (we cannot do this before)
- free_netdev, doing the last stage of destroying an allocated device

Makes xm-test network "03_attach_detach_multiple_pos" pass:
http://xmtest.dague.org/cgi-bin/display?view=single&testid=1068

Signed-off-by: Murillo F. Bernardes <mfb@br.ibm.com>
20 years agoMissing file from previous changeset.
kaf24@firebug.cl.cam.ac.uk [Wed, 28 Dec 2005 14:07:16 +0000 (15:07 +0100)]
Missing file from previous changeset.

20 years agoFix uncleaned vif backend devices when frontend does not finish
kaf24@firebug.cl.cam.ac.uk [Wed, 28 Dec 2005 13:55:55 +0000 (14:55 +0100)]
Fix uncleaned vif backend devices when frontend does not finish
initialization properly.

Signed-off-by: Murillo F. Bernardes <mfb@br.ibm.com>
20 years agoIf netfront fails to allocate a receive skbuff, push all pending
kaf24@firebug.cl.cam.ac.uk [Wed, 28 Dec 2005 11:29:15 +0000 (12:29 +0100)]
If netfront fails to allocate a receive skbuff, push all pending
skbuffs out onto the shared ring. If there are no skbuffs to push,
schedule a timer to try again later. This will avoid interface
lockups in low-memory conditions.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoPrevent vbd frontend from oopsing if the underlying device doesn't exist.
vhanquez@kneesa.uk.xensource.com [Tue, 27 Dec 2005 10:40:33 +0000 (10:40 +0000)]
Prevent vbd frontend from oopsing if the underlying device doesn't exist.

Signed-off-by: Horms <horms@verge.net.au>
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
20 years agoMissed portion of domU initrd patch
djm@kirby.fc.hp.com [Fri, 23 Dec 2005 21:14:21 +0000 (15:14 -0600)]
Missed portion of domU initrd patch
Signed-off-by: <takebe_akio@jp.fujitsu.com>
20 years agoGeneric x86 emulator now properly supports 16-bit addressing
kaf24@firebug.cl.cam.ac.uk [Fri, 23 Dec 2005 17:28:33 +0000 (18:28 +0100)]
Generic x86 emulator now properly supports 16-bit addressing
by narrowing accesses to SI/DI/SP registers. Also supports
real-mode addressing by shifting and adding the appropriate
segment register for certain stack and string operations
where the effective address is not already known.

todo: Stack operations should have address size specified
by B bit in stack segment descriptor, not by default address
size or address-size override. Probably nothing depends on
the proper behaviour though.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoModify CR0 access emulation -- return physical CR0 (except
kaf24@firebug.cl.cam.ac.uk [Fri, 23 Dec 2005 15:42:46 +0000 (16:42 +0100)]
Modify CR0 access emulation -- return physical CR0 (except
for TS) and allow only the same physical flags to be written
back to CR0 by a guest.

Add write-to-CR4 emulation, but check that the write does not
modify any CR4 flags.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoOnly build xenctx on x86_32 and x86_64.
Ian.Campbell@xensource.com [Fri, 23 Dec 2005 09:12:41 +0000 (09:12 +0000)]
Only build xenctx on x86_32 and x86_64.

Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
20 years agoMerge.
Ian.Campbell@xensource.com [Thu, 22 Dec 2005 16:15:33 +0000 (16:15 +0000)]
Merge.

20 years agoThis patch fixes a bug/typo of main.py.
emellor@leeni.uk.xensource.com [Thu, 22 Dec 2005 15:38:10 +0000 (15:38 +0000)]
This patch fixes a bug/typo of main.py.
1. show option "-c" of help of xm dmesg
2. fix value of parameter of arg_check of xm log
3. fix aliases of vbd-create and vbd-destroy

Signed-off-by Yoshinori Katase <y_katase@soft.fujitsu.com>

20 years agoRemove xen specific bug() implementation -- the regular one works just fine.
cl349@firebug.cl.cam.ac.uk [Thu, 22 Dec 2005 14:50:06 +0000 (15:50 +0100)]
Remove xen specific bug() implementation -- the regular one works just fine.

From: "Jan Beulich" <JBeulich@novell.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
20 years agoAdd support to xenctx for printing stack traces on x86_32 and x86_64.
Ian.Campbell@xensource.com [Thu, 22 Dec 2005 14:33:19 +0000 (14:33 +0000)]
Add support to xenctx for printing stack traces on x86_32 and x86_64.

To support this add xc_translate_foreign_address to libxc. This function
walks page tables and translates virtual addresses using a given domain
and vcpu page table.

Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
20 years agoRemove acpi_count_madt functions. Only appear to be used
kaf24@firebug.cl.cam.ac.uk [Wed, 21 Dec 2005 19:18:19 +0000 (20:18 +0100)]
Remove acpi_count_madt functions. Only appear to be used
for diagnostic tracing in xen/ia64.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoRemove unused local variables (from removed REASIGN_PAGE
kaf24@firebug.cl.cam.ac.uk [Wed, 21 Dec 2005 19:17:22 +0000 (20:17 +0100)]
Remove unused local variables (from removed REASIGN_PAGE
function).

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoMerge with xen-ia64-unstable.hg.
kaf24@firebug.cl.cam.ac.uk [Wed, 21 Dec 2005 18:52:00 +0000 (19:52 +0100)]
Merge with xen-ia64-unstable.hg.

20 years agoRemove obsolete MMUEXT_REASSIGN_PAGE. It's not used by
kaf24@firebug.cl.cam.ac.uk [Wed, 21 Dec 2005 18:10:53 +0000 (19:10 +0100)]
Remove obsolete MMUEXT_REASSIGN_PAGE. It's not used by
anyone and is superceded by grant transfers.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoMerge
djm@kirby.fc.hp.com [Wed, 21 Dec 2005 17:56:19 +0000 (11:56 -0600)]
Merge

20 years agoFix gnttab_release_mappings -- it doesn't need to drop
kaf24@firebug.cl.cam.ac.uk [Wed, 21 Dec 2005 17:45:43 +0000 (18:45 +0100)]
Fix gnttab_release_mappings -- it doesn't need to drop
page refcnts for host mappings as they are already
destroyed by put_page_from_l1e(). Also call
gnttab_release_mappings later (after destroying
page-table references) and from common code rather than
arch/x86.

Also a few other misc gnttab cleanups.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoIncrement page reference count for every host/device
kaf24@firebug.cl.cam.ac.uk [Wed, 21 Dec 2005 17:25:34 +0000 (18:25 +0100)]
Increment page reference count for every host/device
mapping created via a grant reference, rather than one
increment for all uses of a single grant reference.
This avoids a nasty situation in put_page_from_l1e()
where we cannot reliably determine whether a mapping was
created via a grant reference and so we must always
decrement the mapped page's reference count.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoDeclare kasprintf before use.
kaf24@firebug.cl.cam.ac.uk [Wed, 21 Dec 2005 17:16:31 +0000 (18:16 +0100)]
Declare kasprintf before use.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoDisable chatty translate_domain_pte messages for normal grant table traffic
djm@kirby.fc.hp.com [Wed, 21 Dec 2005 16:30:10 +0000 (10:30 -0600)]
Disable chatty translate_domain_pte messages for normal grant table traffic

20 years agoFacilitate to debug VTI-domain issue.
djm@kirby.fc.hp.com [Wed, 21 Dec 2005 15:33:45 +0000 (09:33 -0600)]
Facilitate to debug VTI-domain issue.
Signed-off-by Anthony Xu <anthony.xu@intel.com>

20 years agoSupport domU initrd and cmdline (previous cset also)
djm@kirby.fc.hp.com [Wed, 21 Dec 2005 15:31:05 +0000 (09:31 -0600)]
Support domU initrd and cmdline (previous cset also)
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
20 years agodiff -r 545ba1b126ca tools/libxc/xc_linux_build.c
djm@kirby.fc.hp.com [Wed, 21 Dec 2005 15:07:09 +0000 (09:07 -0600)]
diff -r 545ba1b126ca tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c      Tue Dec 20 20:11:17 2005
+++ b/tools/libxc/xc_linux_build.c      Wed Dec 21 11:50:08 2005
@@ -296,9 +296,13 @@
     unsigned long *page_array = NULL;
     struct load_funcs load_funcs;
     struct domain_setup_info dsi;
+    unsigned long vinitrd_start;
+    unsigned long vinitrd_end;
+    unsigned long v_end;
     unsigned long start_page, pgnr;
     start_info_t *start_info;
     int rc;
+    unsigned long i;

     rc = probeimageformat(image, image_size, &load_funcs);
     if ( rc != 0 )
@@ -310,11 +314,13 @@
     if ( rc != 0 )
         goto error_out;

-    dsi.v_start = round_pgdown(dsi.v_start);
-    dsi.v_end   = round_pgup(dsi.v_end);
+    dsi.v_start      = round_pgdown(dsi.v_start);
+    vinitrd_start    = round_pgup(dsi.v_end);
+    vinitrd_end      = vinitrd_start + initrd_len;
+    v_end            = round_pgup(vinitrd_end);

     start_page = dsi.v_start >> PAGE_SHIFT;
-    pgnr = (dsi.v_end - dsi.v_start) >> PAGE_SHIFT;
+    pgnr = (v_end - dsi.v_start) >> PAGE_SHIFT;
     if ( (page_array = malloc(pgnr * sizeof(unsigned long))) == NULL )
     {
         PERROR("Could not allocate memory");
@@ -326,9 +332,38 @@
         PERROR("Could not get the page frame list");
         goto error_out;
     }
+
+#define _p(a) ((void *) (a))
+
+    printf("VIRTUAL MEMORY ARRANGEMENT:\n"
+           " Loaded kernel: %p->%p\n"
+           " Init. ramdisk: %p->%p\n"
+           " TOTAL:         %p->%p\n",
+           _p(dsi.v_kernstart), _p(dsi.v_kernend),
+           _p(vinitrd_start),   _p(vinitrd_end),
+           _p(dsi.v_start),     _p(v_end));
+    printf(" ENTRY ADDRESS: %p\n", _p(dsi.v_kernentry));

     (load_funcs.loadimage)(image, image_size, xc_handle, dom, page_array,
                            &dsi);
+
+    /* Load the initial ramdisk image. */
+    if ( initrd_len != 0 )
+    {
+        for ( i = (vinitrd_start - dsi.v_start);
+              i < (vinitrd_end - dsi.v_start); i += PAGE_SIZE )
+        {
+            char page[PAGE_SIZE];
+            if ( gzread(initrd_gfd, page, PAGE_SIZE) == -1 )
+            {
+                PERROR("Error reading initrd image, could not");
+                goto error_out;
+            }
+            xc_copy_to_domain_page(xc_handle, dom,
+                                   page_array[i>>PAGE_SHIFT], page);
+        }
+    }
+

     *pvke = dsi.v_kernentry;

@@ -358,6 +393,13 @@
     start_info->store_evtchn = store_evtchn;
     start_info->console_mfn   = nr_pages - 1;
     start_info->console_evtchn = console_evtchn;
+    if ( initrd_len != 0 )
+    {
+        ctxt->initrd.start    = vinitrd_start;
+        ctxt->initrd.size     = initrd_len;
+    }
+    strncpy((char *)ctxt->cmdline, cmdline, IA64_COMMAND_LINE_SIZE);
+    ctxt->cmdline[IA64_COMMAND_LINE_SIZE-1] = '\0';
     munmap(start_info, PAGE_SIZE);

     free(page_array);
diff -r 545ba1b126ca xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c        Tue Dec 20 20:11:17 2005
+++ b/xen/arch/ia64/xen/dom_fw.c        Wed Dec 21 11:50:08 2005
@@ -861,9 +861,14 @@
        bp->console_info.orig_x = 0;
        bp->console_info.orig_y = 24;
        bp->fpswa = 0;
-        bp->initrd_start = (dom0_start+dom0_size) -
-                (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
-        bp->initrd_size = ia64_boot_param->initrd_size;
+        if (d == dom0){
+                bp->initrd_start = (dom0_start+dom0_size) -
+                        (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
+                bp->initrd_size = ia64_boot_param->initrd_size;
+        }else{
+                bp->initrd_start = d->arch.initrd_start;
+                bp->initrd_size  = d->arch.initrd_len;
+       }
                 printf(" initrd start %0xlx", bp->initrd_start);
                 printf(" initrd size %0xlx", bp->initrd_size);

diff -r 545ba1b126ca xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Tue Dec 20 20:11:17 2005
+++ b/xen/arch/ia64/xen/domain.c        Wed Dec 21 11:50:08 2005
@@ -297,6 +297,9 @@

        *regs = c->regs;
        d->arch.sys_pgnr = c->sys_pgnr;
+        d->arch.initrd_start = c->initrd.start;
+        d->arch.initrd_len   = c->initrd.size;
+        d->arch.cmdline      = c->cmdline;
        new_thread(v, regs->cr_iip, 0, 0);

        v->vcpu_info->arch.evtchn_vector = c->vcpu.evtchn_vector;
@@ -365,7 +368,7 @@
                    regs->r28 = dom_fw_setup(d,saved_command_line,256L);
                else {
                    regs->ar_rsc |= (2 << 2); /* force PL2/3 */
-                   regs->r28 = dom_fw_setup(d,"nomca nosmp xencons=tty0 console=tty0 root=/dev/hda1",256L);  //FIXME
+                   regs->r28 = dom_fw_setup(d,d->arch.cmdline,256L);
                }
                VCPU(v, banknum) = 1;
                VCPU(v, metaphysical_mode) = 1;
diff -r 545ba1b126ca xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h     Tue Dec 20 20:11:17 2005
+++ b/xen/include/asm-ia64/domain.h     Wed Dec 21 11:50:08 2005
@@ -38,6 +38,9 @@
     u64 image_len;
     u64 entry;
 #endif
+    unsigned long initrd_start;
+    unsigned long initrd_len;
+    char *cmdline;
 };
 #define xen_vastart arch.xen_vastart
 #define xen_vaend arch.xen_vaend
diff -r 545ba1b126ca xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    Tue Dec 20 20:11:17 2005
+++ b/xen/include/public/arch-ia64.h    Wed Dec 21 11:50:08 2005
@@ -276,6 +276,12 @@
     unsigned long start_info_pfn;
 } arch_shared_info_t;

+typedef struct {
+    unsigned long start;
+    unsigned long size;
+} arch_initrd_info_t;
+
+#define IA64_COMMAND_LINE_SIZE 512
 typedef struct vcpu_guest_context {
 #define VGCF_FPU_VALID (1<<0)
 #define VGCF_VMX_GUEST (1<<1)
@@ -289,6 +295,8 @@
     cpu_user_regs_t regs;
     arch_vcpu_info_t vcpu;
     arch_shared_info_t shared;
+    arch_initrd_info_t initrd;
+    char cmdline[IA64_COMMAND_LINE_SIZE];
 } vcpu_guest_context_t;

 #endif /* !__ASSEMBLY__ */

20 years agoThis patch is intended to correct the number of CPUs.
djm@kirby.fc.hp.com [Wed, 21 Dec 2005 14:53:40 +0000 (08:53 -0600)]
This patch is intended to correct the number of CPUs.

Our IPF machines are the following configurations.
 - Total logical cpus = 16
  -- 4 sockets
  -- 2 cores
  -- 2 threads

I changed the setting of BIOS, and invalidated the hyperthread, and I built Xen with NR_CPUS=8.
As a result, it became like attached file xendmesg1.txt.
 - Available cpus 3
 - Total cpus 8

Next, I built Xen with NR_CPUS=16.
As a result, it became like attached file xendmesg2.txt.
 - Available cpus 8
 - Total cpus 16

I thought not to match the analysis of the lsapic entry to the value of NR_CPUS.

It is an outline of patch as follows.
 1. Count up the lsapic entry by using acpi_table_count_madt()/acpi_table_count_madt_family().
 2. Call acpi_parse_lsapic() by using the number of lsapic entries.
 3. Count up the available_cpus by using acpi_parse_lsapic(), however NR_CPUS is not exceeded.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Best Regards,
 Kan

20 years agoNew default config file that works on both tiger4 and HP boxes
djm@kirby.fc.hp.com [Wed, 21 Dec 2005 14:49:31 +0000 (08:49 -0600)]
New default config file that works on both tiger4 and HP boxes

20 years agoFix smp_processor_id to be linked to correct processor id under vcpu, which is
djm@kirby.fc.hp.com [Wed, 21 Dec 2005 14:40:16 +0000 (08:40 -0600)]
Fix smp_processor_id to be linked to correct processor id under vcpu, which is
the exact one updated by scheduler. Or else easy to think how things get
messed under SMP environment. One phenomenon observed is about softirq.
Exit path on CPU1 checks pending indicator by local_cpu_data, and then
goto do_softirq if pending true. However do_softirq uses cpu_data(cpu)
to query pending bit again. Cpu index is aquired from smp_processor_id,
with thread_info->cpu not cared by scheduler. Finally do_softirq on CPU1
tries to operate percpu data on CPU0 then.

Also disable several prints within critical path, like sending IPI. Due to
slow serial speed, this will slow down overall performance heavily since
event channels among CPUs are in traffic.

This patch is necessary for host SMP.

Signed-off-by Kevin Tian <kevin.tian@intel.com>

20 years agoCertain faults should not be reflected if caused with priv=0
djm@kirby.fc.hp.com [Wed, 21 Dec 2005 14:36:03 +0000 (08:36 -0600)]
Certain faults should not be reflected if caused with priv=0
Signed-off-by Kevin Tian <kevin.tian@intel.com>

20 years agoMore pal_flush_cache calls for split cache machines (by Anthony Xu)
djm@kirby.fc.hp.com [Wed, 21 Dec 2005 14:27:09 +0000 (08:27 -0600)]
More pal_flush_cache calls for split cache machines (by Anthony Xu)

20 years agoAdd support for MOVSX/MOVSXD/MOVZX (move-with-extend)
kaf24@firebug.cl.cam.ac.uk [Wed, 21 Dec 2005 13:29:23 +0000 (14:29 +0100)]
Add support for MOVSX/MOVSXD/MOVZX (move-with-extend)
instructions to the generic x86 emulator. Also add
preliminary support for 16-bit addressing: decode the
ModR/M byte properly but still need to access and update
implicit memory operands (esp,esi,edi) with correct width.
Work is also needed to support real-mode addressing.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoremove duplicate code to allocate a string ala printf (using kasprintf)
vhanquez@kneesa.uk.xensource.com [Wed, 21 Dec 2005 11:14:37 +0000 (11:14 +0000)]
remove duplicate code to allocate a string ala printf (using kasprintf)

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
20 years agoImportant domU/vbd fix. Reserve top granule of machine memory for dom0.
djm@kirby.fc.hp.com [Tue, 20 Dec 2005 20:11:17 +0000 (14:11 -0600)]
Important domU/vbd fix.  Reserve top granule of machine memory for dom0.

20 years agoRemove FIX_RSDP_PAGE. Access RSDP via the 'isamap' of low 1MB.
kaf24@firebug.cl.cam.ac.uk [Tue, 20 Dec 2005 17:45:29 +0000 (18:45 +0100)]
Remove FIX_RSDP_PAGE. Access RSDP via the 'isamap' of low 1MB.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoRemove automatic I/O-fault handling in XenLinux. It's now
kaf24@firebug.cl.cam.ac.uk [Tue, 20 Dec 2005 17:34:58 +0000 (18:34 +0100)]
Remove automatic I/O-fault handling in XenLinux. It's now
handled by Xen itself.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoMerged.
emellor@leeni.uk.xensource.com [Tue, 20 Dec 2005 17:16:24 +0000 (17:16 +0000)]
Merged.

20 years agoChanged UUID / Xen handle formatting to be compatible with the OSF DCE UUIDs.
emellor@leeni.uk.xensource.com [Tue, 20 Dec 2005 17:16:15 +0000 (17:16 +0000)]
Changed UUID / Xen handle formatting to be compatible with the OSF DCE UUIDs.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
20 years agoAllow unknown NMIs to be propagated to domain0 via new
kaf24@firebug.cl.cam.ac.uk [Tue, 20 Dec 2005 16:55:20 +0000 (17:55 +0100)]
Allow unknown NMIs to be propagated to domain0 via new
VIRQ_NMI. Also simplify x86_32 NMI handling -- there's
no need to greedily consume IO/parity errors in
assembly code as they can be deferred without causing
an interrupt storm (the NMI pin is always edge-triggered
even though the sources are level-asserted).

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoAdd sound blaster support to VMX device model.
kaf24@firebug.cl.cam.ac.uk [Tue, 20 Dec 2005 11:55:19 +0000 (12:55 +0100)]
Add sound blaster support to VMX device model.

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
20 years agoCurrently there is no generic configure file to compile xenlinux on
kaf24@firebug.cl.cam.ac.uk [Tue, 20 Dec 2005 11:52:38 +0000 (12:52 +0100)]
Currently there is no generic configure file to compile xenlinux on
ia64, since there're several different system types like HP-ZX, DIG,
etc. Current Makefile can't meet this need and default one
(xen0_defconfig_ia64) is only for HP-ZX type. Hence, this patch can
append an additional param to configuration file name to differentiate
system types when make.

Signed-off-by Zhang Xiantao <xiantao.zhang@intel.com>

20 years agoThis patch fix several issue to support >2G 64bit vmx guest in IA-32e
kaf24@firebug.cl.cam.ac.uk [Tue, 20 Dec 2005 11:50:09 +0000 (12:50 +0100)]
This patch fix several issue to support >2G 64bit vmx guest in IA-32e
platform, it includes:
1) One fix on xc_vmx_build.c
2) Change ram_size/phys_ram_size in qemu from int to uint64_t
3) One fix on pcnet unsigned short to unsigned long conversion.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Xin Li <xin.b.li@intel.com>
20 years agoRemove direct references to frame_table array. Use
kaf24@firebug.cl.cam.ac.uk [Tue, 20 Dec 2005 11:46:56 +0000 (12:46 +0100)]
Remove direct references to frame_table array. Use
pfn_to_page (or page_to_pfn) instead.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 years agoFix simulator boot (uses old bootparam format with no initrd)
djm@kirby.fc.hp.com [Mon, 19 Dec 2005 21:18:54 +0000 (15:18 -0600)]
Fix simulator boot (uses old bootparam format with no initrd)